package impl.persons;

import framework.Person;
import framework.PersonContext;

/**
 * Date: 18.04.2008
 * Time: 21:11:53
 *
 * @author Denis DIR Rozhnev
 */
public class Dir implements Person {
    private Person essence;
    private static final String ESSENCE_CLASS = "impl.persons.DirEssence";

    public Dir() {
        try {
            essence = (Person) Class.forName(ESSENCE_CLASS).newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void init(PersonContext ctx) {
        essence.init(ctx);
    }

    @Override
    public String getShortName() {
        return essence.getShortName();
    }

    @Override
    public String getName() {
        return essence.getName();
    }

    @Override
    public String getDescription() {
        return essence.getDescription();
    }

    @Override
    public int deal(Object id) {
        return essence.deal(id);
    }

    @Override
    public void dealed(Object id, int deal) {
        essence.dealed(id, deal);
    }

    @Override
    public Object messageReceived(Object id, Object message) {
        return essence.messageReceived(id, message);
    }
}
